using FluentValidation;

namespace Services.Identity.WebApi.Request.User;
public record AddUserRequest(string UserName, string UserPhone, string Password);
public class AddUserValidator : AbstractValidator<AddUserRequest>
{
    public AddUserValidator()
    {
        RuleFor(x => x.UserName).NotEmpty().WithMessage("用户名不能为空");
        RuleFor(x => x.UserPhone).NotEmpty().WithMessage("手机号不能为空");
        RuleFor(x => x.UserPhone).Length(11).WithMessage("手机号格式不正确");
        RuleFor(x => x.Password).NotEmpty().WithMessage("密码不能为空");
    }
}